package com.codeprophecy.gdoclist.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.gadgets.client.Gadget;
import com.google.gwt.gadgets.client.UserPreferences;
import com.google.gwt.gadgets.client.Gadget.ModulePrefs;
import com.google.gwt.gdata.client.GoogleService;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextArea;

@ModulePrefs(title = "Documents List", author = "codeprophecy", author_email = "codeprophecy1@gmail.com")
public class Gdoclist extends Gadget<UserPreferences> {

	RootPanel root = RootPanel.get();
	String applicationName = "GDocList";
	String feedUrl = "";
	String serviceName = "writely";
	
	@Override
	protected void init(UserPreferences preferences) {
		// TODO Auto-generated method stub
		String uri = "";
		
		Button btnHello = new Button("Fetch DocList");		 
		
		root.add(btnHello);
		
		btnHello.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				Window.alert("Hello World");
				
			}
		});
		
		GoogleService service = GoogleService.newInstance(serviceName, applicationName);
		service.useOAuth("google");

	}
	
	
}
